#include <my_head.h>
#if 0
void sig_func_usr1(int signum){
    printf("收到了一个SIGUSR1的信号\n");
}
void sig_func_usr2(int signum){
    printf("收到了一个SIGUSR2的信号\n");
}
#else
void sig_func(int signum){
    if(SIGUSR1 == signum){
        printf("收到了一个SIGUSR1信号\n");
    }else if(SIGUSR2 == signum){
        printf("收到了一个SIGUSR2信号\n");
    }
}
#endif
int main(int argc, const char *argv[]){
    #if 0
    if(SIG_ERR == signal(SIGUSR1,sig_func_usr1))
        ERR_LOG("signal error");
    if(SIG_ERR == signal(SIGUSR2,sig_func_usr2))
        ERR_LOG("signal error");
    #else
    if(SIG_ERR == signal(SIGUSR1,sig_func))
        ERR_LOG("signal error");
    if(SIG_ERR == signal(SIGUSR2,sig_func))
        ERR_LOG("signal error");
    #endif
    int i = 0;
    while(1){
        printf("hello %d\n",++i);
        sleep(1);
    }
    return 0;
}